home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wgdb-42.lha / wgdb-4.2 / gdb / frame.h < prev    next >
C/C++ Source or Header  |  1992-09-11  |  5KB  |  135 lines

  1. /* Definitions for dealing with stack frames, for GDB, the GNU debugger.
  2.    Copyright (C) 1986, 1989 Free Software Foundation, Inc.
  3.  
  4. This file is part of GDB.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #if !defined (FRAME_H)
  21. #define FRAME_H 1
  22. #include "param.h"
  23.  
  24. /*
  25.  * FRAME is the type of the identifier of a specific stack frame.  It
  26.  * is a pointer to the frame cache item corresponding to this frame.
  27.  * Please note that frame id's are *not* constant over calls to the
  28.  * inferior.  Use frame addresses, which are.
  29.  *
  30.  * FRAME_ADDR is the type of the address of a specific frame.  I
  31.  * cannot imagine a case in which this would not be CORE_ADDR, so
  32.  * maybe it's silly to give it it's own type.  Life's rough.
  33.  *
  34.  * FRAME_FP is a macro which converts from a frame identifier into a
  35.  * frame_address.
  36.  *
  37.  * FRAME_INFO_ID is a macro which "converts" from a frame info pointer
  38.  * to a frame id.  This is here in case I or someone else decides to
  39.  * change the FRAME type again.
  40.  *
  41.  * This file and blockframe.c are the only places which are allowed to
  42.  * use the equivalence between FRAME and struct frame_info *.  EXCEPTION:
  43.  * value.h uses CORE_ADDR instead of FRAME_ADDR because the compiler
  44.  * will accept that in the absence of this file.
  45.  */
  46. typedef struct frame_info *FRAME;
  47. typedef CORE_ADDR    FRAME_ADDR;
  48. #define FRAME_FP(fr)    ((fr)->frame)
  49. #define FRAME_INFO_ID(f)    (f)
  50.  
  51. /*
  52.  * Caching structure for stack frames.  This is also the structure
  53.  * used for extended info about stack frames.  May add more to this
  54.  * structure as it becomes necessary.
  55.  *
  56.  * Note that the first entry in the cache will always refer to the
  57.  * innermost executing frame.  This value should be set (is it?
  58.  * Check) in something like normal_stop.
  59.  */
  60. struct frame_info
  61.   {
  62.     /* Nominal address of the frame described.  */
  63.     FRAME_ADDR frame;
  64.     /* Address at which execution is occurring in this frame.
  65.        For the innermost frame, it's the current pc.
  66.        For other frames, it is a pc saved in the next frame.  */
  67.     CORE_ADDR pc;
  68.     /* The frame called by the frame we are describing, or 0.
  69.        This may be set even if there isn't a frame called by the one
  70.        we are describing (.->next == 0); in that case it is simply the
  71.        bottom of this frame */
  72.     FRAME_ADDR next_frame;
  73.     /* Anything extra for this structure that may have been defined
  74.        in the machine depedent files. */
  75. #ifdef EXTRA_FRAME_INFO
  76.     EXTRA_FRAME_INFO
  77. #endif
  78.     /* Pointers to the next and previous frame_info's in this stack.  */
  79.     FRAME next, prev;
  80.   };
  81.  
  82. /* Describe the saved registers of a frame.  */
  83.  
  84. struct frame_saved_regs
  85.   {
  86.     /* For each register, address of where it was saved on entry to the frame,
  87.        or zero if it was not saved on entry to this frame.  */
  88.     CORE_ADDR regs[NUM_REGS];
  89.   };
  90.  
  91. /* The stack frame that the user has specified for commands to act on.
  92.    Note that one cannot assume this is the address of valid data.  */
  93.  
  94. extern FRAME selected_frame;
  95.  
  96. /* Level of the selected frame:
  97.    0 for innermost, 1 for its caller, ...
  98.    or -1 for frame specified by address with no defined level.  */
  99.  
  100. int selected_frame_level;
  101.  
  102. extern struct frame_info *get_frame_info ();
  103. extern struct frame_info *get_prev_frame_info ();
  104.  
  105. extern FRAME create_new_frame ();
  106. extern void  flush_cached_frames ();
  107. extern void reinit_frame_cache ();
  108.  
  109. extern void get_frame_saved_regs ();
  110.  
  111. extern void  set_current_frame ();
  112. extern FRAME get_prev_frame ();
  113. extern FRAME get_current_frame ();
  114. extern FRAME get_next_frame ();
  115.  
  116. extern struct block *get_frame_block ();
  117. extern struct block *get_current_block ();
  118. extern struct block *get_selected_block ();
  119. extern struct symbol *get_frame_function ();
  120. extern CORE_ADDR get_frame_pc ();
  121. extern CORE_ADDR get_pc_function_start ();
  122. struct block *block_for_pc ();
  123.  
  124. int frameless_look_for_prologue ();
  125.  
  126. void print_frame_args ();
  127.  
  128. /* In stack.c */
  129. extern FRAME find_relative_frame ();
  130. extern int print_stack_frame ();
  131. extern void select_frame ();
  132. extern void record_selected_frame ();
  133.  
  134. #endif /* frame.h not already included.  */
  135.